<script setup lang="ts">
	import { ref } from "vue";
	import { formRules } from "./utils/rule";
	import { FormProps } from "./utils/types";
	import ReCol from "@/components/ReCol";
	const props = withDefaults(defineProps<FormProps>(), {
		formInline: () => ({
			title: "",
			status: 0,
			Id: 0,
		})
	});
	const ruleFormRef = ref();
	const newFormInline = ref(props.formInline);
	function getRef() {
		return ruleFormRef.value;
	}
	defineExpose({ getRef });
</script>

<template>
	<el-form ref="ruleFormRef" :model="newFormInline" :rules="formRules" label-width="auto">
		<el-row :gutter="30">
			<re-col :value="24" :xs="24" :sm="24">
				<el-form-item label="公司名称" prop="companyName">
					<el-input v-model="newFormInline.companyName" clearable placeholder="请输入" />

				</el-form-item>

			</re-col>

			<re-col :value="24" :xs="24" :sm="24">
				<el-form-item label="电话号码" prop="phoneNumber">
					<el-input v-model="newFormInline.phoneNumber" clearable placeholder="请输入" type="number" class="no_number"
          oninput="if(value.length>11)value=value.slice(0,11)"/>
				</el-form-item>
			</re-col>
      <re-col :value="24" :xs="24" :sm="24">
      	<el-form-item label="地址" prop="address">
      		<el-input v-model="newFormInline.address"  clearable type="textarea" :rows="3" placeholder="请输入" />
      	</el-form-item>
      </re-col>
		</el-row>
	</el-form>
</template>
<style scoped>
	.avatar-uploader .el-upload {
		border: 1px dashed var(--el-border-color);
		border-radius: 6px;
		cursor: pointer;
		position: relative;
		overflow: hidden;
		transition: var(--el-transition-duration-fast);
	}

	.avatar-uploader .el-upload:hover {
		border-color: var(--el-color-primary);
	}

	.el-icon.avatar-uploader-icon {
		font-size: 28px;
		color: #8c939d;
		width: 178px;
		height: 178px;
		text-align: center;
	}
</style>
